#include <iostream>
using namespace std;
//
//class Date
//{
//public:
//	Date(int year, int month, int day)
//	{
//		_year = year;
//		_month = month;
//		_day = day;
//	}
//	void Print()
//	{
//		cout << "year:" << _year << endl;
//		cout << "month:" << _month << endl;
//		cout << "day:" << _day << endl << endl;
//	}
//
//private:
//	int _year;
//	int _month;
//	int _day;
//};
//void Test1()
//{
//	Date d1(2024, 2, 1);   
//	d1.Print();
//	const Date d2(2024, 2, 1);
//	d2.Print();
//}
//
//int main()
//{
//	Test1();
//
//	return 0;
//}



int Count = 0;
class Date
{
public:
	Date(int year = 1, int month = 1, int day = 1)
	{
		_year = year;
		_month = month;
		_day = day;
	}
	int Days(int year, int month)
	{
		int a[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		if (month == 2)
			if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
			    return 29;
		return a[month];
	}
	bool operator==(Date d)
	{
		if (d._year == this->_year&&d._month == this->_month&&d._day == this->_day)
			return true;
		return false;
	}
	Date& operator++()
	{
		this->_day += 1;
		if (this->_day>Days(this->_year, this->_month))
		{
			this->_month++;
			this->_day = 1;
		}
		if (this->_month>12)
		{
			this->_year++;
			this->_month = 1;
		}
		return *this;
	}
	int operator-(Date d)
	{
		int res = 1;
		while (!(*this == d))
		{
			++res;
			++d;
		}
		return res;
	}
private:
	int _year;
	int _month;
	int _day;

};

void Test1()
{
	int year, month, day;
	cin >> year >> month >> day;
	Date d1(year, month, day);
	Date d2(year);

	cout << d1 - d2 << endl;
}

int main()
{
	Test1();
	return 0;
}